package com.yao.mybatis.utils;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

/**
 * 将文件解析成流的工具类
 * @author Administrator
 */
public class Resources<in> {

    /**
     * 返回字节流
     * @param resource
     * @return
     */
    public static InputStream getResourceAsStream(String resource) {
        return Resources.class.getClassLoader().getResourceAsStream(resource);
    }

    public static Reader getResourceAsReader(String resource){
        return new InputStreamReader(Resources.class.getClassLoader().getResourceAsStream(resource));
    }
}
